
<!DOCTYPE html>
<html style="font-size:28px;">
<head>
    <title>选择地址</title>
    <meta name="author" content="m.jd.com">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta http-equiv="Expires" CONTENT="-1">
    <meta http-equiv="Cache-Control" CONTENT="no-cache">
    <meta http-equiv="Pragma" CONTENT="no-cache">
    

    
	<link rel="stylesheet" href="//st.360buyimg.com/order/css/order/base.css?v=20160825"/>
	<link rel="stylesheet" href="//st.360buyimg.com/order/css/order/pay.css?v=20160825"/>
	<link rel="stylesheet" type="text/css" href="//st.360buyimg.com/order/misc/skin/20"/>
    <link rel="apple-touch-icon-precomposed" href="//st.360buyimg.com/order/images/apple-touch-icon.png?v=20160825"/>
	<link rel="stylesheet" href="/Public/css.css" />
	<style type="text/css">
		.address_selected{
			border:2px solid red;
		}
	</style>
</head>

<body style="margin:0 auto;">

<div class="header">
    <a href="javascript:history.back(-1);" class="backbtn_02"></a>选择地址
</div>

<div class="common-wrapper" get_str="{$get_str}" lst_sku = "{$lst_sku}">
        <div>
        	<volist name="lst_user_address" id="user_address_en">
        
            <div class="item-addr bdb-1px biz_address_div" address_id="{$user_address_en.address_id}">
                <div class="ia-m m ia-m78 biz_address_select">
                    <div class="mt_new">
                        <span>{$user_address_en.consignee_name}</span>
                        <strong>{$user_address_en.consignee_cellphone}</strong>
                    </div>
                    <div class="mc">
                        <p>
                            {$user_address_en.consignee_province} {$user_address_en.consignee_city} {$user_address_en.consignee_district} {$user_address_en.consignee_address}
                        </p>
                    </div>
                </div>

                <a class="ia-r" href="/buy/updateAddress?lst_sku={$lst_sku}&address_id={$user_address_en.address_id}">
                    <span class="iar-icon"></span>
                </a>
            </div>
			</volist>

        </div>

        <div class="loginact">
	        <a class="hbtn" href="#">确  定  选  择</a>
	        <a class="lbtn" href="/buy/addAddress?lst_sku={$lst_sku}&user_id={$user_id}">+ 新  增  地  址</a>
	    </div>
</div>

</body>
<script type="text/javascript" src="/Public/js/zepto.js"></script>
<script type="text/javascript" src="/Public/js/wj.js"></script>
<script type="text/javascript" src="/Public/js/ajaxService.js"></script>
<script type="text/javascript" src="/Public/js/common.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	//地址选择
	$('.biz_address_select').bind('click', function(){
		$('.address_selected').find('.ia-l').remove();
		$('.address_selected').removeClass('address_selected');
		
		$(this).parents('.biz_address_div').addClass('address_selected');
		$(this).before('<div class="ia-l"></div>');
	});
	
	
	//确定选择按钮
	$('.hbtn').bind('click', function(){
		var address_id = $('.address_selected').attr("address_id");
		if(!address_id){
			alert('请选择一条地址信息');
			return;
		}
		var lst_sku = $('.common-wrapper').attr("lst_sku");
		if(!lst_sku){
			alert("未有购买商品");
			return;
		}
		window.location.href = '/buy/checkout?lst_sku='+lst_sku+'&address_id='+address_id;
	});
	
	//新增地址按钮
	$('.biz_address_select').bind('click', function(){
		$('.address_selected').find('.ia-l').remove();
		$('.address_selected').removeClass('address_selected');
		
		$(this).parents('.biz_address_div').addClass('address_selected');
		$(this).before('<div class="ia-l"></div>');
	});
});
</script>
</html>
